import request from '@/utils/request'

export function getOrgTree() {
  return request({
    url: 'admin/org/tree',
    method: 'get'
  })
}
export function fetchList(query) {
  return request({
    url: 'admin/org/list',
    method: 'get',
    params: query
  })
}
export function fetchOrgList() {
  return request({
    url: 'admin/org/list',
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: 'admin/org/deleteById/' + id,
    method: 'get'
  })
}

export function getObj(id) {
  return request({
    url: 'admin/org/id/' + id,
    method: 'get'
  })
}
export function putObj(obj) {
  return request({
    url: 'admin/org',
    method: 'put',
    data: obj
  })
}
export function addObj(obj) {
  return request({
    url: 'admin/org',
    method: 'post',
    data: obj
  })
}
export function getUserInfo() {
  return request({
    url: 'admin/user/info',
    method: 'get'
  })
}
